<?php

// +----------------------------------------------------------------------
// | i18n语言包工具
// +----------------------------------------------------------------------
// | 版权所有 2019~2022 saruri 系统集成中国有限公司 [ http://www.saruri.cn ]
// +----------------------------------------------------------------------
// | 官方网站: https://saruri.cn
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | github 代码仓库：https://gitee.com/saruri/languagePackage.git
// +----------------------------------------------------------------------

namespace saruri;

require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/service/SaruriService.php';

use \service\SaruriService;
$excel_path = '';
$js = '';

$param_arr = getopt('e:j:');
//var_dump($param_arr);

if (!isset($param_arr['e'])) {
    echo "请输入excel文件路径：";
    $excel_path = trim(fgets(STDIN));
    //$param_arr['e'] = $excel_path;
    echo '您输入的excel名是：' . $excel_path;
}
if (!isset($param_arr['j'])) {
    fwrite(STDOUT, '请输入js ：');
    $js = fgets(STDIN);
    if (!$js) {
        exit("无输入");
    }
    echo '您输入的js名是：' . $js;
} else {
    $js = $param_arr['j'];
}
if ($excel_path and $js) {
    $param_arr['e'] = $excel_path;
    $param_arr['j'] = $js;
}

//var_dump($param_arr);
$result = new SaruriService();
$result->run($param_arr);

//exit("测试完成");
